from django.contrib import admin
from sutras.models import (Sutra, SutraEdition,
                           SutraEditionPage,
                           SutraEditionChar,
                           TranscriptionOrder,
                           PrintOrder, PrintOrderDetail,
                           UserTranscription,
                           UserPageTranscription,
                           UserAddress,
                           AssistantRelation,
                           UserLevelInfo,
                           UserFavorite, VowConfig,
                           UserLayout, LayoutConfig,
                           Temple, HotwordConfig, FontColorConfig,
                           TypesetConfig, MaterialConfig, BindConfig,
                           CustomUser
                           )


class UserTranscriptionAdmin(admin.ModelAdmin):
    list_display = ('id', 'get_user_name', 'status')
    # fields = ()

    def get_user_name(self, obj):
        return obj.user.uid


admin.site.register(CustomUser)
admin.site.register(Sutra)
admin.site.register(SutraEdition)
admin.site.register(SutraEditionPage)
admin.site.register(SutraEditionChar)
admin.site.register(TranscriptionOrder)
admin.site.register(PrintOrder)
admin.site.register(PrintOrderDetail)
admin.site.register(UserTranscription, UserTranscriptionAdmin)
admin.site.register(UserPageTranscription)
admin.site.register(UserAddress)
admin.site.register(AssistantRelation)
admin.site.register(UserLevelInfo)
admin.site.register(UserFavorite)
admin.site.register(UserLayout)
admin.site.register(Temple)
admin.site.register(HotwordConfig)
admin.site.register(FontColorConfig)
admin.site.register(TypesetConfig)
admin.site.register(MaterialConfig)
admin.site.register(BindConfig)
admin.site.register(VowConfig)
admin.site.register(LayoutConfig)
